package org.gntc.prayer;

import org.gntc.prayer.friends.FriendsMainActivity;
import org.gntc.prayer.myprayer.PrayerListActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class HomeActivity extends Activity
{
	/** Called when the activity is first created. */
	
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.home);
	    
	    // Add click listener
        addButtonClickListener();
	    
    	// Intro Activity 호출
    	//Intent intent = new Intent(HomeActivity.this, IntroActivity.class);
    	//startActivity(intent);
	}
	
	/**
     * 메뉴 버튼 클릭 리스트 등록
     */
    public void addButtonClickListener()
    {
    	// My prayer
        Button btnMyBBS = (Button)findViewById(R.id.btn_my_prayer);
        
        btnMyBBS.setOnClickListener
        (
        	new Button.OnClickListener()
        	{
        		public void onClick(View v)
        		{
        			Intent intent = new Intent(HomeActivity.this, PrayerListActivity.class);
        			startActivity(intent);
        		}
        	}
        );
        
        // Friends
        Button btnFriends = (Button)findViewById(R.id.btn_friends);
        
        btnFriends.setOnClickListener
        (
        	new Button.OnClickListener()
        	{
        		public void onClick(View v)
        		{
        			Intent intent = new Intent(HomeActivity.this, FriendsMainActivity.class);
        			startActivity(intent);
        		}
        	}
        );
        
        // Etc
        Button btnEtc = (Button)findViewById(R.id.btn_settings);
        
        btnEtc.setOnClickListener
        (
        	new Button.OnClickListener()
        	{
        		public void onClick(View v)
        		{
        			Toast.makeText(HomeActivity.this, R.string.under_construction, Toast.LENGTH_SHORT).show();
        		}
        	}
        );
    }

}
